<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLikesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('likes', function(Blueprint $table)
		{
			$table->increments('id');
            $table->tinyInteger('like_type')->default(0);
            $table->integer('item_id')->default(0);
            $table->integer('creator_id')->default(0);

            $table->timestamps();

            $table->unique(array('like_type', 'item_id', 'creator_id'));
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::dropIfExists('likes');
	}

}
